const Router = require('koa-router')

const router = new Router()

router.prefix('/test')

router.post('/geta',async (ctx)=>{

    let list = Object.keys(ctx.request.body)
    
    ctx.body = {
        code:200,
        data:JSON.parse(list[0]),
        msg:"成功"
    };
    console.log('tag')
})

router.get('/getList',async (ctx)=>{

    ctx.body ={
        code:200,
        data:{          
            req_query:ctx.request.query,
        },
        msg:"成功"
    }

})

router.post('/login',async (ctx)=>{
    console.log('tag123')
    let list = Object.keys(ctx.request.body)
    console.log('list',ctx.request.body.username)
    
    ctx.body = {
        code:200,
        data:[],
        msg:"成功"
    };
   
})


module.exports = router